import axiosReq from '@/utils/axios-req'
import { useProjectInfoStore } from '@/store/projectInfo'
const BASE_URL = import.meta.env.VITE_APP_BASE_URL_SYH

/**
 * 展示评委已完成的评审项（退回）
 * @param data 
 * {
  "projectId": 15,
  "judgeId": 36
}
 * @returns 
 */
export const getJudgeCompletedList = (data: any) => {
  const projectId = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/projectItemInfo/viewCompletedList`,
    method: 'POST',
    data: {
      ...data,
      projectId
    }
  })
}

/**
 * 退回已完成评审项
 * @param data
 * {
  "projectId": 15,
  "judgesId": 36,
  "itemId": 75
}
 * @returns
 */
export const returnProjectItemInfo = (data: any) => {
  const projectId = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/projectItemInfo/back`,
    method: 'POST',
    data: {
      ...data,
      projectId
    },
    showMsg: true
  })
}
